Salutations to ArcViewers: Sorry for the delay in posting the summary. I received one relevant response for this which I enclose. However, I carved out a solution myself that works well for me (also enclosed). It should work for others in similar boat. My Original Question: Hi Arcviewers: PURPOSE: I want to start arcview from another application (tcl/tk, a VisualBasic like tool) - and I want to be able to run an Avenue script while starting up that opens a theme from a shape file and does a few other things ie., I want a batch like execution of (arcview + Avenue script). BACKGROUND KNOWLEDGE: I know that Arcview first runs a "startup" script from the system/etc directory, next loads the "system" default project (default.apr) and then the "user" default project and that the system and user default projects accesses the script "appl.initialize" that among other things parses the commandline arguments. WHAT I DID: However, I don't know how to go about this process...I created a "user" default.apr file with the script containing: av.getproject.MakeSysDefault("D:\prasad\default.apr".AsFileName,FALSE) and then tried to modify the "appl.initialize" script contained in this default.apr (see below for the details) I then started ArcView from MS-DOS prompt with the foll. command: D:\wineda> D:\ESRIAV\AV_GIS30\ARCVIEW\BIN32\arcview.exe d: \prasad\default.apr WHAT ACTUALLY HAPPENED: ArcView starts up but then I get a system error that says "Tried to reference an invalid memory location blah blah" and terminates arcview..... I PLEAD IGNORANCE: What am I doing wrong? Is there a way to gracefully implement what I want? Any help will be gratefully summarised. MY SYSTEM: ArcView 3.0a on Windows NT 4.0 (SP 5) with 784 MB of memory. Thanks much. Prasad ********************************************| 1 of 2: Alan's Response: (thanks much...I did not try it since mine worked) Below is a sample of the first part of a manually modified APR file: /3.2 (ODB.1 FirstRootClassName: "Project" Roots: 2 Version: 32 ) (Project.2 Name: "Example.apr" CreationDate: "Wednesday, March 24, 1999 07:08:35" GUIName: "Project" Win: 3 CSMgr: 4 DocExts: 5 VisGUIWidth: 70 Doc: 6 Doc: 40 Doc: 63 Buttons: 140 Buttons: 141 Buttons: 142 Scripts: 143 Prefs: 146 GUI: 149 WorkDir: 986 WinX: -4 WinY: -3 WinW: 1288 WinH: 1003 StartUp: "Script_Name" SerialNumber: "798481101598" Note the line inserted using a word processor called StartUp: "Script_Name" Replace "Script_Name" with the name of the script you want to use. Also make sure you make a backup of the APR file. Don't believe this is a documented method but it works. Have fun Alan D. Jacobson, PE GIS Programmer/Engineer Telecommunications/Land Resources Division ARCADIS Geraghty and Miller PO Box 1717, Greenville, SC 29602 420 Park Avenue, Greenville, SC 29601 Tel 864.242.1717 Fax 864.235.9062 Direct 864.241.5244 Email ajacobson@arcadis-us.com ************************************************************ 2 of 2: My solution. I modified (compiled,embeded)the system script -> appl.initialize and saved it (default.apr) in my $HOME directory (Project->Customize->Make Default) Here is the new appl.initialize script that default.apr uses...this modification is for one user only (to make it a system wide thing, copy $HOME/default.apr to $AVHOME/etc/default.apr). The neat thing about this change is that it does not modify the original default behaviour in any way. Hope this is helpful to those who want to glue together disparate applications using tcl/tk. Prasad argList = self if (argList.Count = 0) then ' No arguments supplied...so, open up arcview with new project new = Project.Make new.GetWin.Open new.SetModified(false) else ' There are arguments...so test it and see ' if it is a project file or your own arguments tstName = argList.Get(0).AsFileName tstNames = argList.Get(0).AsString old =Project.Open(tstName) if (old = nil) then 'Since the first argument is not a vaild project, ' these must be your own Arguments ' So parse these arguments and do what is needed. if(tstNames = "xxx") then ' parse other arguments you may have supplied.... else 'Do some thing else ... still your own arguments... end else 'The first argument is a project so open it .. default behaviour old.GetWin.Open old.SetModified(false) end end av.Run("Codepage.Install",nil) ***************************************************************** Mr. Anantha Prasad, Ecologist/GIS Specialist USDA Forest Service, Northeastern Research Station 359 Main Rd., Delaware OHIO 43015 USA Ph: 740-368-0103 Email: aprasad@fs.fed.us Web: http://www.fs.fed.us/ne/delaware/index.html Don't Miss Climate Change Tree Atlas at: http://www.fs.fed.us/ne/delaware/atlas/index.html ******************************************************************